c4fd69ebaad3c6182251bbd9d2c899be30ac15b7,gdx/src/com/badlogic/gdx/graphics/glutils/VertexBufferObjectWithVAO.java,VertexBufferObjectWithVAO,bindAttributes,#ShaderProgram#number[]#,161

Before Change



	private void bindAttributes(ShaderProgram shader, int[] locations) {
		final GL20 gl = Gdx.gl20;
		gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, bufferHandle);
		final int numAttributes = attributes.size();
		if (locations == null) {
			for (int i = 0; i < numAttributes; i++) {

After Change


					stillValid = location == this.cachedLocations.get(i);
				}
			} else {
				stillValid = locations.length == this.cachedLocations.size;
				for (int i = 0; stillValid && i < numAttributes; i++) {
					stillValid = locations[i] == this.cachedLocations.get(i);
				}
			}
		}

		if (!stillValid) {
			Gdx.gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, bufferHandle);
			unbindAttributes(shader);
			this.cachedLocations.clear();

			for (int i = 0; i < numAttributes; i++) {
				VertexAttribute attribute = attributes.get(i);
				if (locations == null) {
					this.cachedLocations.add(shader.getAttributeLocation(attribute.alias));
				} else {
					this.cachedLocations.add(locations[i]);
				}

				int location = this.cachedLocations.get(i);
				if (location < 0) {
					continue;
				}